/**
 * @author SaoE
 * @date 2025/2/21 10:58
 */
public class _101 {
    public boolean isSymmetric(TreeNode root) {
        return inorder(root.left, root.right);
    }
    public boolean inorder(TreeNode rootL, TreeNode rootR){
        if (rootL == null && rootR == null) {
            return true;
        }
        if (rootL == null && rootR != null){
            return false;
        }
        if (rootL != null && rootR == null){
            return false;
        }
        if (rootL.val != rootR.val) {
            return false;
        }
        return inorder(rootL.left, rootR.right) && inorder(rootL.right, rootR.left);
    }

}
